/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.common.g;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.qihoo.gamecenter.sdk.common.i.m;
import java.util.HashMap;
import java.util.Map;

public class a {
    public static String a = "360wy";
    private static String b = null;

    public static Map a(String paramString) {
        HashMap localHashMap = new HashMap();
        localHashMap.put("reason", paramString);
        return localHashMap;
    }

    public static void a(Context paramContext, Long paramLong) {
        SharedPreferences localSharedPreferences = paramContext.getSharedPreferences("pay_start_time", 0);
        localSharedPreferences.edit().putLong("pay_time", System.currentTimeMillis() / 1000L).commit();
        localSharedPreferences.edit().putLong("pay_amount", paramLong.longValue()).commit();
    }

    public static void b(Context paramContext, Long paramLong) {
        SharedPreferences localSharedPreferences = paramContext.getSharedPreferences("pay_start_time", 0);
        localSharedPreferences.edit().putLong("pay_amount", paramLong.longValue()).commit();
    }

    public static Map a(Context paramContext) {
        SharedPreferences localSharedPreferences = paramContext.getSharedPreferences("pay_start_time", 0);
        Long localLong1 = Long.valueOf(localSharedPreferences.getLong("pay_time", 0L));
        Long localLong2 = Long.valueOf(localSharedPreferences.getLong("pay_amount", 0L));
        HashMap localHashMap = new HashMap();
        if (localLong1.longValue() != 0L) {
            localHashMap.put("duration_time",
                    String.valueOf(System.currentTimeMillis() / 1000L - localLong1.longValue()));
            localHashMap.put("pay_amount", String.valueOf(localLong2.longValue() / 100L));
        }
        return localHashMap;
    }

    public static void a(Context paramContext, boolean paramBoolean) {
        m.a(paramContext, "com.qihoo.gamecenter.plugin.common.user_experience", paramBoolean);
    }

    public static boolean b(Context paramContext) {
        return m.b(paramContext, "com.qihoo.gamecenter.plugin.common.user_experience", true);
    }

    public static String a() {
        if (b == null)
            b = "1.0.4(242)";
        return b;
    }

    public static void b() {
        if ("SOCIAL".equalsIgnoreCase("PAY")) {
            a = "360sj";
        }
        else if ("SOCIAL_PAY".equalsIgnoreCase("PAY")) {
            a = "360sp";
        }
        else {
            if (!("PAY".equalsIgnoreCase("PAY")))
                return;
            a = "360wy";
        }
    }

    static {
        b();
    }
}